<template>
	<view>
		<view class="tie" @click="jump('/pages/tie/view?id='+item.id)">
			<view class="tie1">
				<view class="status">{{item.statustext}}</view>
				<view class="tie1_right time11">
					发布时间:{{item.addtime}}
				</view>
			</view>
			<view class="tie2" >{{item.content}}</view>
			<view class="tie3" v-if="item.imgs">

				<block v-if="item.imgs.length>1">
					<image v-for="(item1,index1) in item.imgs" :key="index1" mode="aspectFill"
						@tap.stop="previewImage(item.imgs,index1)" :src="item1"></image>
				</block>
				<block v-else>
					<image class="img100" v-for="(item1,index1) in item.imgs" :key="index1" mode="aspectFill"
						@tap.stop="previewImage(item.imgs,index1)" :src="item1"></image>

				</block>

			</view>
			
			<view class="tie2" v-if="item.nodesc" ><text style="color: red;">审核不通过原因:</text>{{item.nodesc}}</view>

		</view>
		<view class="item_bottom"  v-if="item.status!=2">
          

			<view class="ibottom">
				<u-button type="info" :plain="true" shape="square" size="mini"
					@click="jump('/pages/tie/edit?id='+item.id)">编辑</u-button>
			</view>
			<view class="ibottom">
				<u-button type="info" :plain="true" shape="square" size="mini" @click="del(item.id)">删除
				</u-button>
			</view>

          





		</view>
		<view class="kg" style="margin-left: -20rpx; margin-right: -20rpx;"></view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: {}
			}

		},
		name: "tie",
		data() {
			return {

			};
		},
		methods:{
			del(id) {
			
				uni.showModal({
					title: '提示',
					content: '确定删除吗',
					success: res => {
						if (res.confirm) {
			
							this.$u.post('index.php?mod=app&act=del&table=tie', {
								ids: id
							}).then(res => {
								 this.$emit("updatedata");
							});
			
						} else if (res.cancel) {
			
						}
					}
				});
			
			},
		}
	}
</script>

<style scoped>
	.status {
		font-size: 14px;
		color: #F0AD4E;
	}

	.time11 {
		color: #999;font-size: 12px;
	}

	.tie1 {
		display: flex;
		justify-content: space-between;
	}

	.tie {
		margin: 20rpx auto;
	}

	.tie1_right {
		margin-left: 10px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.name {
		font-size: 32rpx;
		margin-bottom: 10rpx;
	}

	.time {
		font-size: 20rpx;
		color: #999;
	}

	.tie2 {
		margin: 20rpx auto;
		line-height: 25px;
		font-size: 28rpx;
	}

	.tie3 {
		display: flex;
		flex-wrap: wrap;
	}

	.tie3 image {
		width: 31%;
		border-radius: 10rpx;
		height: 220rpx;
		padding: 1%;
	}

	.tie3 .img100 {
		width: 100%;
		border-radius: 10rpx;
		height: 500rpx;
	}

	.tie4 {
		display: flex;
		justify-content: space-between;
		margin-top: 40rpx
	}

	.share,
	.comment,
	.fav {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 250rpx;
	}

	.title4 {
		padding-left: 10rpx;
	}
	
	.item_bottom {
		display: flex;
		justify-content: flex-end;
		margin-top: 10px;
		border-top: 1rpx solid #dfdfdf;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}
	
	.ibottom {
		width: auto;
		margin: 0px 5px;
	}
	
	.dicon {
		padding: 0px 15rpx;
	}
	
</style>
